(fn make-levenshtein (row column)
  (with (width  (length row)
         height (length column)
         w      (++ width)
         h      (++ height)
         m      (make-array w h))
;    (dotimes (i w)
;      (= (aref m i) (make-array)))
    (dotimes (i w)
      (dotimes (j h)
        (= (aref m i j ) 0)))
    (dotimes (i w)
      (= (aref m i 0) i))
    (dotimes (j h)
      (= (aref m 0 j ) j))
    (dotimes (jc height) 
      (dotimes (ic width) 
        (with (i (++ ic)
               j (++ jc))
          (= (aref m i j)
             (min (number+ (aref m ic jc)
                  (? (== (elt row ic) (elt column jc))
                     0
                     1))
                  (number+ (aref m ic j) 1)
                  (number+ (aref m i jc) 1))))))
    m))

(fn levenshtein (row column)
  (aref (make-levenshtein row column) (length row) (length column)))
